<?php

header('Content-Type:text/html;charset=utf-8');

@$a=$_POST['userName'];
@$b=$_POST['password'];


$PDO=new PDO('mysql:dbname=test;charset=UTF8;','root');

$sel=$PDO->prepare('select * from user where userName=:name');

$isok=$sel->execute(array('name'=>$a));

if($isok){
	$bb=$sel->fetchALL(PDO::FETCH_NAMED);
	if(empty($bb)){
		echo "恭喜你，注册成功";
	}else{
		echo "账号已存在";
		header('Refresh:2;url=zc.php');
	}
}



?>